// https://min.erkantv.cn:443/han/hanJuji

import {
	request
} from "@/utils/request.js";


// 电影信息
export function videoById(id) {
	return request({
		url: '/collection/id',
		data: {
			id: id
		}
	});

}



// 电影演员
export function actorById(id) {
	return request({
		url: '/collectionActor/videoId',
		data: {
			Id: id
		}
	});

}

// 摘要
export function ImgById(id) {
	return request({
		url: '/collectionImg/getId',
		data: {
			Id: id
		}
	});

}


// 触底刷新
export function swiperimgsBanner(pageNum) {
	return request({
		url: '/collection/orderLast',
		data: {
			pageNum: pageNum,
			pageSize: 12,
			type: 0,
			order: '',
			yesVideo: false
		}
	});

}

// 评论
export function VideoCommend(pageNum, videoId) {
	return request({
		url: '/collectionComment/list',
		data: {
			pageNum: pageNum,
			pageSize: 12,
			videoId: videoId
		}
	});

}

// 插入评论
export function insertCommend(videoId, username, userId, content, userImg) {
	return request({
		url: '/collectionComment/insert',
		data: {
			videoId: videoId,
			username: username,
			userId: userId,
			content: content,
			userImg: userImg,
			time: new Date().getTime()
		}
	});

}

// 剧集和综艺Url
export function videoUrls(videoId) {
	return request({
		url: '/collectionUrl/videoId',
		data: {
			videoId: videoId
		}
	});

}


// 剧集关联的其他季
export function seriesVideo(seriesId) {
	return request({
		url: '/collection/seriesId',
		data: {
			seriesId: seriesId
		}
	});

}

// 进行收藏
export function insertCollent(userId, videoId) {
	return request({
		url: '/collectionCllect/insert',
		data: {
			userId: userId,
			videoId: videoId
		}
	});

}

// 判断是否已收藏
export function collectionCollent(userId, videoId) {
	return request({
		url: '/collectionCllect/all',
		data: {
			userId: userId,
			videoId: videoId
		}
	});

}


// 进行推荐
export function insertRecommend(userId, videoId) {
	return request({
		url: '/collectionRecommend/insert',
		data: {
			userId: userId,
			videoId: videoId
		}
	});

}
// 判断是否已推荐
export function collectionRecommend(userId, videoId) {
	return request({
		url: '/collectionRecommend/all',
		data: {
			pageNum : 1,
			pageSize : 1,
			userId: userId,
			videoId: videoId
		}
	});

}

// 更新观看记录
export function WatchUpdate(userId, videoId) {
	return request({
		url: '/collectionWatch/update',
		data: {
			userId: userId,
			videoId: videoId
		}
	});

}